<script type="text/javascript">
    //
    <!--#include virtual="/static_public/public_menu/environment/environment.js"-->
</script>
<!--#include virtual="/static_public/inc/bj_report.html"-->
<!--[if lte IE 8]>
<script type="text/javascript">
    //ie 8以下跳转至浏览器升级页面
    (function () {
        var path = '/page/update_browser.shtml';
        var currentPath = location.pathname;
        if (currentPath !== path && currentPath !== '/ydxs_static/page/proxy.ashx') {
            window.location.href = window['ENVIRONMENT_YUNKE'].qmyx + path + '?ret_url=' + encodeURIComponent(location.href);
        }
    })();
</script>
<![endif]-->
<script type="text/javascript" src="http://img-dev.myscrmimg.cn/static_public/js/lib/sea.js"></script>
<script>
    (function () {
        window.STATIC_HOST = 'img-dev.myscrmimg.cn';

        function getPath(url, defaults) {
            var reUrlPath = /(?:\w+:)?\/\/[^/]+([^?#]+)/;
            var urlParts = url.match(reUrlPath) || [url, defaults];
            return urlParts.pop();
        }

        seajs.on('fetch', function (data) {
            var uri = data.uri;
            if (uri) {
                if (uri.indexOf(location.host) > -1 || uri.indexOf(window.STATIC_HOST) > -1) {
                    //替换成CDN域名
                    var requestUri = uri.replace(location.host, window.STATIC_HOST);

                    var path = getPath(requestUri);

                    var transferUri;
                    if (path.indexOf('/static_public') === 0) {
                        transferUri = 'http://' + STATIC_HOST + path;
                    } else if (path.indexOf('/ydxs_static') === 0) {
                        transferUri = 'http://' + STATIC_HOST + '/projects/qmyx' + path;
                    } else if (path.indexOf('/projects') !== 0) {
                        //绝对路径转换的，需要加上项目路径
                        transferUri = 'http://' + STATIC_HOST + '/projects/qmyx' + path;
                    } else if (requestUri != uri) {
                        transferUri = requestUri;
                    }

                    if (transferUri) {
                        data.requestUri = transferUri;
                        seajs.cache[transferUri] = seajs.cache[uri];//ie9-10 定义了新模块，exec执行时取得的是原模块会报错（factory在新模块上）
                    }
                }
            }
        });
    })();
</script>

<script type="text/javascript">
    seajs.config({
        base: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/js/',
        baseRel2Cdn: '/projects/qmyx',//站点目录相对cdn根目录路径，构建脚本使用
        alias: {
            "seajsPlaceHolder": "seajsPlaceHolder",
            'jquery': '/static_public/js/jquery.js',
            'jqueryui': 'lib/jqueryui/jquery-ui.min.js',
            "dialog": "/static_public/js/artdialog.js",
            "dialogplus": "/static_public/js/artdialog.js",
            "datepicker": "/static_public/js/lib/wdatepicker.cmd.js",
            "util": "plugins/util.js",
            "angularPublicInterceptor": "/static_public/js/angular_public_interceptor.js",
            "angular-interceptor": "plugins/angular-interceptor.js",
            "angular": '/static_public/node_modules/angular/angular.min.js',
            "angular-route": "/static_public/node_modules/angular-route/angular-route.js",
            "angular-messages": "/static_public/node_modules/angular-messages/angular-messages.js",
            "angular-ui": "plugins/angular-ui.js",
            "webuploader": "lib/webuploader/webuploader.min.js",
            "plupload": "lib/plupload/plupload.full.min.js",
            "moment": "lib/moment.js",
            "underscore": "/static_public/node_modules/underscore/underscore.cmd.js",
            "jqtree": "plugins/jqtree/jqtree.min.js",
            "introjs": "plugins/introjs/intro.min.js",
            "dropdownlist": "plugins/dropdownlist/dropdownlist.min.js",
            "ui": "plugins/ui.js",
            "pagination": "/static_public/js/lib/pagination/jquery.pagination.js",
            "storage": "/static_public/js/lib/storage/storage.min.js",
            "tmpl": "/static_public/node_modules/art-template/dist/template.js",
            "uploader": "plugins/uploader/jquery.fileupload.min.js",
            "select": "plugins/select/select.js",
            "permission": "/static_public/js/permission.js",
            "authorize": "service/authorize",
            "side": "service/side.js",
            "ui-router": "lib/angular/angular-ui-router.min.js",
            "dragdrop": "lib/angular/angular-dragdrop.js",
            "areabox": "/static_public/js/lib/areabox/areabox.js",
            "bootstrap.min": "/static_public/js/lib/bootstrap-cmd-min.js",
            "environment": "/static_public/public_menu/environment/environment",
            "placeholder": "/static_public/js/lib/fixPlaceholder/placeholder.js",
            "global": "service/global.js"
        },
        paths: {},
        map: [
            [/^(.*\.(?:css|js))(.*)$/i, '$1?201511101719']
        ],
        preload: ['jquery', '/static_public/js/token'],
        debug: true,
        charset: 'utf-8'
    });
    //全局配置参数
    var G_CONFIG = {
        domain: "myscrm.cn", //域名
        api_prefix: "/api/index.php?r=" //后台接口地址前缀
    };
</script>
<!--#include virtual="/static_public/inc/bj_init.html"-->
<!--#if expr="$REQUEST_URI != /update_browser\.shtml/"-->
<!-- js:lib/lib.js-->
<!-- js:common.js-->
<!--#endif-->
